package sdk8.stringuse;

import java.math.BigDecimal;

/**
 * 取出特定字符
 * 方法：
 * 1.split
 * 2.正则表达式1
 */
public class RegexDemo1 {
    public static void main(String[] args) {
        //取出第一个价格
        String price = "48.01 - 235.00";
        String[] split = price.split("-");
        System.out.println("取出："+split[0]);
        Double aDouble = Double.valueOf(split[0]);
        System.out.println("Double装箱:"+aDouble);
        System.out.println("decimal:"+new BigDecimal(aDouble.toString()));
    }
}
